{extend name='admin@main'}
{block name="button"}
<button data-modal='{:url("add")}' data-title="添加等级" class='layui-btn layui-btn-sm layui-btn-primary'>添加等级</button>
{/block}
{block name="content"}
<div class="think-box-shadow">
    <table class="layui-table margin-top-20" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
            <th class='text-left nowrap'>等级id</th>
            <th class="text-left" >等级名称</th>
            <th class="text-left" >等级描述</th>
            <th class="text-left" style="width: 20%">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
            <td class='text-left nowrap'>{$vo.id|default=''}</td>
            <td class='text-left nowrap'>{$vo.name|default=''}</td>
            <td class='text-left nowrap'>{$vo.desc|default=''}</td>
            <td class='text-left' style="width: 20%">
                <a data-title="编辑" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>



    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
<script>
    function btn_confirm(msg,fun,id) {
        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
            var url = "/user/level/"+fun;
            layer.closeAll();
            $.ajax({
                type: "post",
                url: url,
                data: {id:id},
                dataType: "json",
                async: false,
                success: function (data) {
                    layer.msg(data.info);
                    setTimeout(function () {
                        window.location.reload();
                    },1000)
                }
            });
        });
    }

</script>
{/block}



